package com.sogoodsoft.web.crm;

import org.springframework.beans.factory.annotation.Autowired;
import org.springside.modules.orm.PropertyFilter;

import com.sogoodsoft.entity.crm.Sms;
import com.sogoodsoft.service.common.AbstractService;
import com.sogoodsoft.service.crm.SmsService;
import com.sogoodsoft.util.InfosysSecurityUtil;
import com.sogoodsoft.web.BaseAction;

public class SmsAction extends BaseAction<Sms, Long> {

	/**
     * 
     */
    private static final long serialVersionUID = 1L;
    @Autowired
	private SmsService service;
	
	
	@SuppressWarnings("rawtypes")
    @Override
	protected AbstractService getService() {
		return service;
	}


	/* 
	 * 非管理员，只能查询自己的短信记录
	 */
	@Override
	protected void fixFilter() {
		if(!InfosysSecurityUtil.isAdmin()){
			PropertyFilter prop = new PropertyFilter("EQL_task_userid", String.valueOf(InfosysSecurityUtil.getCurrentUser().getId()));
			filters.add(prop);
		}
	}
	
	

}
